$(document).ready(function(){
	$('.t_content img[alt]').load(function(){
		altTag = $(this).attr('alt');
		classes = $(this).attr('class');
		if (classes == 'calendar_trigger'){
			return;
		}
		imgDest = $(this).attr('src');
		imgWidth = $(this).width();
		uniqueID = Math.round(Math.random()*99999);
		if (!classes || classes=="undefined") {classes = '';}
		if($("body").attr('id') !== "ohc"){
			$(this).replaceWith('<div id="C-'+uniqueID+'" class="img_credit '+classes+'" style="width:'+(imgWidth+4)+'px"><img src="'+imgDest+'" class="replaced_image" /><p>'+altTag+'</p></div>');
		}
		$('#C-'+uniqueID+' img').each(function(){
			this.src=imgDest;
		});

                $('#C-'+uniqueID).each(function(){
                        $(this).parent().css('float','right');
                });
	});


	// check for available alerts
	var alertBox = '';
	alertBox = document.getElementById('alertbox');
	if(alertBox){
		// show alerts
		tb_show("Important Updates and Show Information", '#TB_inline?height=300&width=400&inlineId=alertbox');
	}

});
